package cn.tedu.sk.controller;


import cn.tedu.sk.entity.Product;
import cn.tedu.sk.entity.vo.ProductVo;
import cn.tedu.sk.service.ProductService;
import cn.tedu.sk.web.ResponseResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("product")
public class ProductController {

    @Autowired
    private ProductService productService;


    @GetMapping("getAll")
    public ResponseResult<List<ProductVo>> selectAll() {
        List<ProductVo> list=productService.selectAll();
//        return new ResponseResult<List<ProductVo>>().ok(list);
        return new ResponseResult<List<ProductVo>>().defaultOk(list);
    }


}
